<?php

namespace app\index\controller\my;

use app\index\model\UM as UM;
use app\index\service\NumberService;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;
use think\Request as Request;

/**
 * LawyerNumber 控制器
 * Class LawyerNumber
 * @package app\index\controller\my;
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 * @see \app\index\validate\my\LawyerNumber
 */
class LawyerNumber
{
    // 请求参数
    private Request $request;
    private NumberService $numberService;


    public function __construct(Request $request, NumberService $numberService)
    {
        $this->request = $request;
        $this->numberService = $numberService;
    }

    /**
     * 详情
     * @param UM|null $user
     * @return ApiResponse
     * @url /my/lawyer_number/read
     */
    public function read(?UM $user): ApiResponse
    {
        return ApiResponse::success($this->numberService->numberOfLawyer($user));
    }

}
